GXGetShapeGlobalBounds
You can use theGXGetShapeGlobalBounds
function to determine the bounding rectangle of a shape in global coordinates.
boolean GXGetShapeGlobalBounds(gxShape source, gxViewPort port, gxViewGroup group, gxRectangle *bounds);
- source
- A reference to the shape whose bounding rectangle you wish to determine in global coordinates.
port
- A reference to a view port to which the shape is drawn.
group
- A reference to the view group that defines the global coordinates.
bounds
- A pointer to a rectangle structure. On return, the structure contains the bounding rectangle for the shape, in the global coordinates of the specified view group.
- function result
true
if the bounding rectangle appears in global space;false
if it does not.DESCRIPTION
TheGXGetShapeGlobalBounds
function returns a value that specifies whether the bounding rectangle of the shape drawn to the specified view port appears anywhere in the global space of the specified view group. The view port must belong to the view group, and it must be referenced in the view port list of the shape's transform object.The
GXGetShapeGlobalBounds
function also returns in thebounds
parameter the bounding rectangle of that part of the shape that can be drawn through the specified view port. The function returns the bounding rectangle after the shape's transform clip, mapping and style have been applied, and after all view port mappings and clips have been applied, from the view port specified in theport
parameter to the root view port in the view port hierarchy (if any). The dimensions of the rectangle are in the global coordinates of the view group.If you specify
nil
for theport
parameter,GXGetShapeGlobalBounds
includes all view ports specified in the source shape's transform's view port list. If you specifynil
for thegroup
parameter,GXGetShapeGlobalBounds
includes all view groups of all specified view ports.To determine a shape's bounding rectangle in geometry-space coordinates, use the
GXGetShapeBounds
function. To determine a shape's bounding rectangle in local coordinates, use theGXGetShapeLocalBounds
function. To determine a shape's bounding rectangle in device coordinates, use theGXGetShapeDeviceBounds
function.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil invalid_viewPort_reference invalid_viewGroup_reference parameter_is_nil (debugging version) Notices (debugging version) transform_references_disposed_viewPort SEE ALSO
For an example of the use of this function, see Listing 7-15 on page 7-64.The
GXGetShapeBounds
function is described in the geometric operations chapter of Inside Macintosh: QuickDraw GX Graphics. TheGXGetShapeLocalBounds
function is described on page 7-96. TheGXGetShapeDeviceBounds
function is described on page 7-116.